Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback to frontmatter excerpt if available #1673

Closed

Conversation

chiedo
Copy link

@chiedo chiedo commented Aug 1, 2017

Currently if there is no node.edge.excerpt, the frontmatter excerpt is still overwritten.

This fixes that.

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit b51a41f

https://deploy-preview-1673--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit b51a41f

https://deploy-preview-1673--gatsbygram.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit b51a41f

https://deploy-preview-1673--gatsbyjs.netlify.com

@KyleAMathews
Copy link
Contributor

A little worried this is making the default setup too specific. If a user hasn't added excerpt to their frontmatter, then they'll get a cryptic GraphQL error (which we really need to improve).

Perhaps it'd be better if you just overrode the query/serializer for your site?

@nicholaswyoung thoughts?

@chiedo
Copy link
Author

chiedo commented Aug 1, 2017

Good point @KyleAMathews

I don't see an obvious way to override the serializer. I may be missing something?

If not, I'll submit a PR.

@KyleAMathews
Copy link
Contributor

Oh you're right, doesn't look there is a way yet.

@chiedo
Copy link
Author

chiedo commented Aug 1, 2017

Want me to work on that and PR?

@KyleAMathews
Copy link
Contributor

So it looks like you can pass custom serializers but it's not documented :-)

f.serialize && typeof f.serialize === `function` ? f.serialize : serialize

A PR adding documentation would be most excellent!

@chiedo
Copy link
Author

chiedo commented Aug 1, 2017

Will do! :)

@chiedo chiedo closed this Aug 1, 2017
@chiedo chiedo deleted the gatsby-plugin-feed-excerpt-fallback branch August 1, 2017 17:30
@secretfader
Copy link

I'm just now seeing this. Having GitHub notifications pushed aside in the segmented Gmail inbox is still... interesting.

Yeah, I do a lot of work with custom serializers on my site, which is principally why I wrote #1548. I just saw #1681, so I assume this is fixed. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants